package com.fancyears.clientfunction;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: fancyears·milos·malvis
 * @Description:
 * @Date: Created in  2018/12/21 14:08
 * @Modified By:
 */
@SpringBootApplication
@EnableEurekaClient
@RestController
@EnableAutoConfiguration
//不能直接放到java文件下运行，需要放到package中
//需要以SpringBoot项目的方式运行而不是直接运行main方法，否则会注册失败
public class FancyearsClientFunction extends SpringBootServletInitializer {
    public static void main(String[] args) {
        SpringApplication.run(FancyearsClientFunction.class, args);
    }
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(FancyearsClientFunction.class);
    }
}